import 'package:flutter/material.dart';
import 'package:kasax/commons/commons.dart';
import 'package:kasax/utils/route_utils.dart';
import 'package:kasax_demos2/day18_anims/second_anim_test.dart';

class PageSwitchDemo1 extends StatefulWidget {
  const PageSwitchDemo1({Key? key}) : super(key: key);

  @override
  _PageSwitchDemo1State createState() => _PageSwitchDemo1State();
}

class _PageSwitchDemo1State extends State<PageSwitchDemo1> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("界面切换动画"),
      ),
      body: Container(
        child: Column(
          children: [
            buildCommonRaisedButton("默认切换", 20.0, () {
              RouteUtils.push(context, SecondPageAnim());
            }),
            buildCommonRaisedButton("pushLeft2Right", 20.0, () {
              RouteUtils.pushLeft2Right(context, SecondPageAnim());
            }),
            buildCommonRaisedButton("pushRightToLeft", 20.0, () {
              RouteUtils.pushRight2Left(context, SecondPageAnim());
            }),
            buildCommonRaisedButton("pushTop2Bottom", 20.0, () {
              RouteUtils.pushTop2Bottom(context, SecondPageAnim());
            }),
            buildCommonRaisedButton("pushBottom2Top", 20.0, () {
              RouteUtils.pushBottom2Top(context, SecondPageAnim());
            }),
          ],
        ),
      ),
    );
  }
}
